<!--
 * @Description:
 * @Author 卞鹏飞 <228443632@qq.com>
 * @create 26/09/24 PM1:45
 -->
<!--default-->
<script>
export default { name: 'Demo' }
</script>
<!--setup-->
<script setup>
import { onMounted, getCurrentInstance, ref } from 'vue'
// import BaseAreaCascader from '@shared/base/base-area-cascader' // 地区
import FatherSonAreaCascader from '@shared/base/base-area-cascader/father-son-area-cascader' // 地区
import data from '@shared/base/base-area-cascader/father-son-area-cascader/data' // 地区
import { openModal } from '@shared/base/open'
import Editor from '@shared/base/editor'
import { useRouterPlus } from '@/router/use-router-plus'

const { proxy } = getCurrentInstance()
const props = defineProps({})
const emit = defineEmits([])

const { router } = useRouterPlus()
/* 状态 */

const values = ref([
  ['320000', '320100'],
  ['320000', '320200'],
  ['320000', '320300', '320302']
])

/* 方法 */

const onChange = () => {
  router.closeTab(undefined, { autoJump: false })
  router.push({ path: '/home', refresh: true })
}

const onOpen = () => {
  openModal(Editor, { height: '400px' }, { title: '22342' })
}

/* 计算 */

/* 监听 */

/* 周期 */
onMounted(() => {})

/* 暴露 */
defineExpose({
  $: proxy.$
})
</script>

<!--render-->
<template>
  <div class="page">
    <el-button @click="onOpen">
      打开
    </el-button>
    <el-button @click="onChange">
      切换
    </el-button>
    {{ values }}
    <!-- 内容区 -->
    <FatherSonAreaCascader
      v-model="values"
      :options="data"
      :show-all-levels="false"
    />
  </div>
</template>

<!--style-->
<style scoped lang="less">
.page {
  min-height: var(--default-layout-page-view-min-height);
  background: #fff;
}
</style>
